package com.example.cryptodemo.config;

import com.example.cryptodemo.aes.AesException;
import com.example.cryptodemo.aes.BizMsgCrypt;
import com.example.cryptodemo.aes.BizMsgCryptUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 加密配置
 *
 * @author Yunkai Luo
 * @since 10:24 2021/11/5
 **/
@Configuration
public class CryptoConfig {
    String encodingAesKey = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG";
    String token = "pamtest";
    @Bean
    public BizMsgCrypt bizMsgCrypt() throws AesException {
       return BizMsgCryptUtil.getBizMsgCrypt(
                token+BizMsgCrypt.COLON+encodingAesKey
        );
    }
}
